*** Replication Data for: "Policy-taking styles in anti-Covid policies: regional and country comparisons" ***

use "C:\'your directory'\Eu29 style mobility.dta"

xtset countrycode date2

xtline c2, tlabel(, angle(ninety) format(%tdNN/CCYY))

xtreg workplace i.dow c.c2, fe
estimates store fixed
xtreg workplace i.dow c.c2, re
estimates store random
hausman fixed random
xttest0

**Table 1
xtreg workplace i.dow c.c2
xtreg workplace i.dow ib5.geo2 c2 
xtreg workplace i.dow ib5.geo2 c2 cnot2 economicsupportindex services poor density capital logpop newcasessmoothedperthousand trust20 date2

**Figure 2
xtreg workplace i.dow ib5.geo2##c.c2 ib5.geo2##c.cnot2 ib5.geo2##c.economicsupportindex services poor density capital newcasessmoothedperthousand logpop trust20 date2
margins, dydx(c2) at(geo2 =(1(1)5)) vsquish
marginsplot, recast(scatter) ciopts(lcolor(navy) lwidth(medthin)) yline(0, lp(dash) lcolor(red)) xlabel(1(1)5, angle(90)) xlabel(, labsize(small)) ylabel(, labsize(small)) ytitle("") xtitle("") graphregion(color(white)) bgcolor(white) title("Average marginal effects of work regulation", size(medsmall))


** Coefficients for Figure 3
xtreg workplace i.dow i.countrycode c2 cnot2 economicsupportindex newcasessmoothedperthousand date2, baselevel
margin countrycode
* For appropriateness (invert sign -> coefx)

xtreg workplace i.dow i.countrycode##c.c2 i.countrycode##c.cnot2 i.countrycode##c.economicsupportindex newcasessmoothedperthousand date2
margins, dydx(c2) at(countrycode=(1(1)29)) vsquish
* For conditionality (invert sign -> coefy)

marginsplot, recast(scatter) ciopts(lcolor(navy) lwidth(medthin)) yline(0, lp(dash) lcolor(red)) xlabel(1(1)29, angle(90) labsize(small)) ylabel(, labsize(small)) ytitle("") xtitle("") graphregion(color(white)) bgcolor(white) title("Average marginal effects of work regulation", size(medsmall))



use "C:\'your directory'\Eu29 style plot.dta"

*Figure 3
eclplot coefx coefxmin coefxmax coefy, yscale(norev) hor ytitle(Consequentiality, size(medsmall)) ylabel(, labsize(small)) xtitle(Appropriateness, size(medsmall)) xlabel(, labsize(small)) rplot(rcap) estopts(msize(vtiny) mcolor(gs11)  mlabel(ctry) mlabs(vsmall)) ciopts(msize(tiny) lcolor(gs11) lw(vthin)) yline(.1120451, lcolor(red) lw(thin) lpattern(dash)) xline(23.30467, lcolor(red) lw(thin) lpattern(dash)) plot(rcap coefymin coefymax coefx, msize(vsmall) lcolor(gs11) lwidth(vthin)) graphregion(color(white))

*correlations (Table A.5 in Appendix)
pwcorr coefx coefy civic trust rulelaw, sig


**Appendix
use "C:'your directory'\Eu29 mobility plot.dta" 

xtset countrycode weektot
**Figure A.1
xtline workplace, yline(0, lcolor(red) lwidth(vthin)) ytitle ("Change in workplace mobility")
**Table A.1
tabstat workplaces, statistics( mean sd min max ) by(countrycode)

**Figure A.2
xtline c2, ytitle ("Workplace regulation")
**Table A.2
tabstat c2, statistics( mean sd min max ) by(countrycode)

use "C:\'your directory'\Eu29 style mobility.dta"

**Table A.3
tabstat cnot2 economicsupportindex newcasessmoothedperthousand logpop, statistics( mean min sd max ) by(country)

**Table A.4
tabstat density services trust20 capital poor , statistics( mean min sd max ) by(country)


*Coefficients for Fugure A.4 Using residuals
xtreg workplace services poor density capital logpop trust20

predict fixedresid, u
predict errorresid, e
predict resid, ue

xtreg resid i.dow i.countrycode c2 cnot2 economicsupportindex newcasessmoothedperthousand date2, baselevel
margin countrycode
* For appropriateness (invert sign -> residx)

xtreg resid i.dow i.countrycode##c.c2 i.countrycode##c.cnot2 i.countrycode##c.economicsupportindex newcasessmoothedperthousand date2
margins, dydx(c2) at(countrycode=(1(1)29)) vsquish
* For conditionality (invert sign ->residy)

marginsplot, recast(scatter) ciopts(lcolor(navy) lwidth(medthin)) yline(0, lp(dash) lcolor(red)) xlabel(1(1)29, angle(90) labsize(small)) ylabel(, labsize(small)) ytitle("") xtitle("") graphregion(color(white)) bgcolor(white) title("Average marginal effects of work regulation", size(medsmall))


use "'your directory'\Eu29 style plot.dta" 

**Figure A.4
eclplot residx residxmin residxmax residy, yscale(norev) hor ytitle(Consequentiality, size(medsmall)) ylabel(, labsize(small)) xtitle(Appropriateness, size(medsmall)) xlabel(, labsize(small)) rplot(rcap) estopts(msize(vtiny) mcolor(gs11)  mlabel(ctry) mlabs(vsmall)) ciopts(msize(tiny) lcolor(gs11) lw(vthin)) yline(.1120451, lcolor(red) lw(thin) lpattern(dash)) xline(.6867228, lcolor(red) lw(thin) lpattern(dash)) plot(rcap residymin residymax residx,  msize(vsmall) lcolor(gs11) lwidth(vthin)) graphregion(color(white))



